<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@include file="../../common/includeBaseSet.jsp" %>
<%@include file="../../common/includeSystemSet.jsp" %>
<%@include file="../../common/operation_forbid.jsp" %>
<%@include file="../../common/jsVersion.jsp" %>
<script type="text/javascript">
   function setProjectHouseType(){
	   var url="${jypath}/estate/projectHouseType/index?projectId=${project.id}&menu=${menu}";
	   window.location.href=url;
   }  
   
   function toBatchUpdate(){
	   var url="${jypath}/estate/projectRoom/toBatchUpdate?projectId=${project.id}";
	   window.location.href=url;
   } 
   
   function toBatchImport(){

		var id = "${project.id}";
	   	var merchantId = "${project.merchantId}";
	   	var tabKey = "batchImp_" + id;
       	var url = "/estate/import/index?id=${project.id}&menu=${menu}";
	   	if(merchantId== "1" && merchantId == "3"){
            url = "/estate/import/indexLC?id=${project.id}&menu=${menu}";
		}
      	parent.openMenu("0",tabKey,"","批量导入",url);
   }
   
   function toBack(){
 	   var url="${jypath}/estate/project/index?menu="+$("#menuId").val();
	   window.location.href=url;
   }
   
   $(function(){

	   $(".imgblock").click(function(){
		  var checkImg = $(this).children().attr("src");
		  var array = new Array();
		  var parentId =  $(this).parent().attr("id");
		  array.push({ url:checkImg,caption: getFileName(checkImg),options:{side:'left'}});
		  var allImg = $("#"+parentId+ " .imgblock img");
		 	for(var i=0;i<allImg.length;i++){
		 		if(allImg.eq(i).attr("src")!=checkImg){
		 			array.push({ url:allImg.eq(i).attr("src") , caption: getFileName(allImg.eq(i).attr("src")),options:{side:'left'}});
		 		}
		 	}
		 	Strip.show(array);
	   });
   });
   
   
   function replaceFileUrl(ftpUrl){
   	if(ftpUrl==null||ftpUrl==""){
   		return ftpUrl;
   	}
   	//取得文件明
   	var fileName=ftpUrl.substring(ftpUrl.indexOf("?")+1,ftpUrl.length);
   	ftpUrl=ftpUrl.replace(new RegExp("/","gm"),"?");  
   	ftpUrl=ftpUrl.substring(0,ftpUrl.indexOf("?fileName="));
   	return "?fileUrl="+ftpUrl+"&"+fileName;
   }
   
	function getFileName(ftpUrl){
		var fileName = ftpUrl.substring(ftpUrl.indexOf("=")+1,ftpUrl.length);
		var aLink = replaceFileUrl(ftpUrl);
		var abtn = "<a href='${jypath}/common/file/downloadFile"+aLink+"'>"+fileName+"</a>";
		return abtn;
	}
 
</script>
<script type="text/javascript" src="${jypath}/static/js/strip.min.js"></script>
<link rel="stylesheet" href="${jypath}/static/css/strip.css" />
<style type="text/css">
	.innerinputwrap .uploadimg{ margin-left:120px;}
	.uploadimg .inner:after{content:".";display:block;visibility:hidden;height:0;line-height:0;font-size:0;clear:both}
	.uploadimg .inner{zoom:1}
	.uploadimg .inner{ margin-left:-11px;}
	.uploadimg a{ float:left; display:block; width:108px; height:108px; border:solid 1px #ddd; margin-right:18px; margin-bottom:18px; cursor:pointer;}
	.uploadimg .checked{ border:dashed 1px #e74f44;}
	.uploadimg .add{ background:#eee url(${jypath}/resources/images/icon_add.png) no-repeat 50% 50%; border:dashed 1px #ddd;position:relative; overflow:hidden;}
	.uploadimg .add input{position:absolute;font-size:100px;right:0;top:0;opacity:0}
	.uploadimg .imgblock{ position:relative;}
	.uploadimg .imgblock:hover{ border:dashed 1px #e74f44;}
	.uploadimg .imgblock .close{ position:absolute; right:-11px; top:-11px; display:none; width:23px; height:23px; background:url(${jypath}/resources/images/icon_close.png) no-repeat;}
	.uploadimg .imgblock:hover .close{ display:block;}
	.uploadimgtt{ line-height:36px;}
</style>
<div class="widget-main customBtn">
	 <c:forEach var="btn" items="${permitBtn}">
        	<c:choose>
				<c:when test="${btn.permission=='estate:import:importExcel'}">
				 <button type="button" onclick="toBatchImport()"  class="btn btn-primary btn-sm">
			<span class="glyphicon glyphicon-minus">批量导入</span>
			</button>
			&emsp;
				</c:when>
				<c:when test="${btn.permission=='estate:projectRoom:saveBatchData'}">
				<button type="button" onclick="toBatchUpdate()"  class="btn btn-primary btn-sm">
		<span class="glyphicon glyphicon-minus">批量修改</span>
	</button>
	&emsp;
				</c:when>
				<c:when test="${btn.permission=='estate:projectHouseType:list'}">
				<button type="button" onclick="setProjectHouseType()" class="btn btn-primary btn-sm">
		<span class="glyphicon glyphicon-minus">设置户型</span>
	</button>	
	
	&emsp;
				</c:when>
			</c:choose>
			</c:forEach>


   
	
	
	<button type="button" onclick="toBack()" class="btn btn-primary btn-sm">
		<span class="glyphicon glyphicon-minus">返回</span>
	</button>
</div>
<table  class="table table-bordered table-hover">
	<tr>
		<td
			style="background-color: #D8D8D8; font-size: 16px; font-weight: bold;"
			colspan="2">项目信息</td>
	</tr>
	<tr>
		<td width="50%"><b>项目名称：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.projectName}</td>
		<td width="50%"><b>排序编号：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.sort}</td>
	</tr>
	<tr>
		<td><b> 分期数：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.stagesNum}</td>
		<td><b>所在城市：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${area.areaFullName}
		</td>
	</tr>
	<tr>
		<td><b>产品类型：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
<%-- 		<c:choose>
				<c:when test="${project.projectType eq 99}">${project.remark}</c:when>
				<c:otherwise> ${projectTypeName} </c:otherwise>
		</c:choose> --%>
		${projectTypeName}${project.remark}
		</td>
		<td><b> 容积率：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.plotRatio}</td>
	</tr>

	<tr>
		<td><b>绿化率：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.greeningRate}%</td>
		<td><b>占地面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.floorSpace}万平方米</td>
	</tr>

	<tr>
		<td><b>总户数：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.householdsTotal}户</td>
		<td><b>车位数：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.carportTotal}个</td>
	</tr>

	<tr>
		<td><b>车位配比：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.carportMatching}</td>
		<td><b>销售热线：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.salesHotline}</td>
	</tr>

	<tr>
		<td><b>售楼地址：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.salesAddress}</td>
		<td><b>物业公司：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.propertyCompany}</td>
	</tr>

	<tr>
		<td><b>项目公司名称：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.developerName}</td>
		<td><b>项目公司地址：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.developerAddress}</td>
	</tr>

	<tr>
		<td><b>楼盘地址：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.premisesAddress}</td>
		<td><b>产权年限：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.propertyYear}</td>
	</tr>


	<tr>
		<td><b>建造进度：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${project.buildingSchedule}</td>
		<td><b>开工时间：&emsp;&emsp;&emsp;</b>&emsp;&emsp;<fmt:formatDate
				value="${project.startTime}" pattern="yyyy年MM月dd日" /></td>
	</tr>

	<tr>
		<td><b>交付情况：&emsp;&emsp;&emsp;</b>&emsp;&emsp; <c:choose>
				<c:when test="${project.deliveryStatus eq 0}">未交付</c:when>
				<c:when test="${project.deliveryStatus eq 1}">已交付</c:when>
			</c:choose></td>
		<td><b>交付时期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;<fmt:formatDate
				value="${project.deliveryDate}" pattern="yyyy年MM月dd日" /></td>
	</tr>
	<tr>
		<td colspan="2">
			<b>装修标准：&emsp;&emsp;&emsp;</b>
			&emsp;&emsp;<c:choose>
				<c:when test="${project.renovationType eq 0}">精装</c:when>
				<c:when test="${project.renovationType eq 1}">毛坯</c:when>
				<c:when test="${project.renovationType eq 2}">其他${project.renovationDesc}</c:when>
			</c:choose>
		</td>
	</tr>
	<tr>
		<td><b>销售情况：&emsp;&emsp;&emsp;</b>&emsp;&emsp; <c:choose>
				<c:when test="${project.salesStatus eq 0}">在售</c:when>
				<c:when test="${project.salesStatus eq 1}">已售</c:when>
			</c:choose>
		</td>
		<td>
			<b>项目类型：&emsp;&emsp;&emsp;</b>${itemTypeName}
		</td>
	</tr>
<!-- 	<tr> -->
<!-- 		<td colspan="1"> -->
<!-- 			<b>预售证领取日期：</b>&emsp;&emsp; -->
<%-- 			<fmt:formatDate value="${project.salesPermissionDate}" pattern="yyyy年MM月dd日" /> --%>
<!-- 		</td> -->
<!-- 		<td> -->
<%-- 			<b>预售证编号：&emsp;&emsp;&emsp;</b>${project.salesPermissionNo} --%>
<!-- 		</td> -->
<!-- 	</tr> -->
	<tr>
		<td colspan="2">
			<b>楼盘概况：&emsp;&emsp;&emsp;</b>
			&emsp;&emsp;${project.premisesCase}
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<b>项目配套：&emsp;&emsp;&emsp;</b>
			&emsp;&emsp;${project.projectRequirement}
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<b>交通情况：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${project.trafficCase}
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">项目LOGO：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_logo_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 1}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>

						</c:forEach>

					</div>

				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">总平图：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_plane_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 2}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">周边配套图：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_periphery_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 3}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">效果图：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_effect_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 7}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">交通图：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_traffic_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 4}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">实景图：</p>
				<div class="uploadimg">

					<div class="inner mt10" id="project_real_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 5}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2">
			<div class="innerinputwrap innermiddle">
				<p class=" ttleft tt">样板图：</p>
				<div class="uploadimg">
					<div class="inner mt10" id="project_model_img_div">
						<c:forEach var="img" items="${imgList}">
							<c:choose>
								<c:when test="${img.projectImgType eq 6}">
									<a class="imgblock"> <img height="108px" width="108px" src="${img.normalUrl}" /></a>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</div>
		</td>
	</tr>
</table>

<table class="table table-bordered table-hover">
	<tr>
		<td style="background-color: #D8D8D8; font-size: 16px; font-weight: bold;" colspan="2">
		   房产信息
		</td>
	</tr>
	<tr>
		<td width="50%"><b>所属社区：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.community}</td>
		<td width="50%"><b>所属社区：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.street}</td>
	</tr>
	
	<tr>
		<td><b>管理区地址：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.precinctAddress}</td>
		<td><b>邮政编码：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.zipCode}</td>
	</tr>
	
	<tr>
		<td><b>物业类型：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
		<c:choose>
				<c:when test="${projectInfo.tenementType eq 1}">住宅</c:when>
				<c:when test="${projectInfo.tenementType eq 2}">非住宅</c:when>
		</c:choose>
		</td>
		<td><b>交付日期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;<fmt:formatDate value="${projectInfo.deliveryDate}" pattern="yyyy年MM月dd日" /> </td>
	</tr>
	
	<tr>
		<td><b>合同面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp; ${projectInfo.contactArea}m² </td>
		<td><b>计费面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.billingArea}m²</td>
	</tr>
	
	<tr>
		<td><b>总建筑面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.overallFloorage}m² </td>
		<td><b>地上面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.groundArea}m²</td>
	</tr>
	
	<tr>
		<td><b>地下面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.undergroundArea}m² </td>
		<td><b>地上面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.groundArea}m²</td>
	</tr>
	
		<tr>
		<td><b>可出租面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.rentableArea}m² </td>
		<td><b>自用面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.ownArea}m²</td>
	</tr>
	
	<tr>
		<td><b>地下停车场：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.undergroundParkingArea}m² </td>
		<td><b>数量：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.undergroundParkingNum}个</td>
	</tr>
	
	<tr>
		<td><b>绿化面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.greenSpace}m²</td>
		<td><b>占地面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.floorSpace}m²</td>
	</tr>
	
		<tr>
		<td><b>住宅建筑面积：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.housingArea}m²</td>
		<td><b>四至边界： &emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.fourBorder}</td>
	</tr>
	
	<tr>
		<td><b>停车位：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.parking}个</td>
		<td><b>地上机动车位： &emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.groundMotor}个</td>
	</tr>
	
		<tr>
		<td><b>地下机动车位：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.undergroundMotor}个</td>
		<td><b>地上非机动车位： &emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.groundNonMotor}个</td>
	</tr>
	 
			<tr>
		<td><b>地下非机动车位：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.undergroundNonMotor}个</td>
		<td><b>总户数： &emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.totalHouse}</td>
	</tr>
	
	<tr>
		<td><b>常住人口数：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.permanentPopulation}</td>
		<td><b>总人口数： &emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.totalPopulation}</td>
	</tr>
	
	<tr>
		<td><b>暂住人口数：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectInfo.temporaryPopulation}</td>
		<td><b>管理区负责人： &emsp;&emsp;&emsp;</b>&emsp;&emsp;	${projectInfo.principal}</td>
	</tr>
	 
	
</table>

<table class="table table-bordered table-hover">
	<tr>
		<td style="background-color: #D8D8D8; font-size: 16px; font-weight: bold;" colspan="2">
		  项目设置
		</td>
	</tr>
	<tr style="display:none">
		<td width="50%"><b>预定默认定金：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectSetting.defaultEarnest}元 </td>
		<td width="50%"><b>签约能否修改备案：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			<c:choose>
					<c:when test="${projectSetting.signupRecordChange eq 0}">不能</c:when>
					<c:when test="${projectSetting.signupRecordChange eq 1}">能</c:when>
			</c:choose>
		</td>
	</tr>
	
	<tr style="display:none">
		<td><b>预定能否修改折扣：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
		<c:choose>
				<c:when test="${projectSetting.reserveDiscountChange eq 0}">不能</c:when>
				<c:when test="${projectSetting.reserveDiscountChange eq 1}">能</c:when>
		</c:choose>
		
		</td>
		<td><b>无房认筹是否精选到组团：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
		<c:choose>
				<c:when test="${projectSetting.needToPremises eq 0}">不能</c:when>
				<c:when test="${projectSetting.needToPremises eq 1}">能</c:when>
		</c:choose></td>
	</tr >
	
	<tr style="display:none">
		<td colspan="2">
			<b>开盘时间：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			<fmt:formatDate value="${projectSetting.openTime}" pattern="yyyy年MM月dd日" />
		</td>
	</tr>
		
	<tr style="display:none">
		<td><b>开盘前案场客户有效期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectSetting.validBeforeField}天 </td>
		<td>
			<b>开盘后案场客户有效期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${projectSetting.validAfterField}天
		</td>
	</tr>
	<tr style="display:none">
		<td><b>开盘前渠道客户有效期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectSetting.validBeforeChannel}天 </td>
		<td><b>开盘后渠道客户有效期：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${projectSetting.validAfterChannel}天
		</td>
	</tr>
	<tr style="display:none">
		<td colspan="2">
			<b>是否启用打印有效协议：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			 <c:choose>
				<c:when test="${projectSetting.validPrint eq 0}">是</c:when>
				<c:when test="${projectSetting.validPrint eq 1}">否</c:when>
		    </c:choose>
		</td>
	</tr>
	<tr>
		<td>
			<b>公司总经理：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${generalManager.userName}
		</td>
		<td><b>项目总：&emsp;&emsp;&emsp;</b>&emsp;&emsp;${projectLeader.userName} </td>
	</tr> 
	<tr>
		<td><b>经纪总：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			 ${saleLeader.userName}
		</td>
		<td>
			<b>销售经理：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${fieldLeader.userName}
		</td>
	</tr> 
	 
	<tr>
		<td>
			<b>销管经理：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${maLeader.userName}
		</td>
		<td>
			<b>财务经理：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${financeLeader.userName}
		</td>
	</tr>  
	
	<tr>
		<td>
			<b>区域领导：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${areaLeader.userName}
		</td>
		<td>
			<b>区域经理：&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			${areaManager.userName}
		</td>
	</tr>
	
	
	   
</table>


